﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Nop.Web.CDN.Infrastructure
{
    public static class Extensions
    {
        public static ActionResult NotModified(this Controller controller, HttpResponseBase response)
        {
            response.Cache.SetCacheability(HttpCacheability.Public);
            response.Cache.SetExpires(DateTime.Now.AddYears(1));
            //Clears all content output from the buffer stream.
            response.ClearContent();
            response.Cookies.Clear();

            // set to true to stop the response from being sent.
            response.SuppressContent = true;
            return new HttpStatusCodeResult(304, "Not Modified");
        }
    }
}